﻿#include "Program.h"
#include "../Shared/Packet.h"
#include "../Server/Settings.h"
#include "Server.SMain.h"
#include "../Server/Logger.h"

using namespace log4net;

namespace Server::MirForms
{

    void Program::Main()
    {
        Packet::IsServer = true;

        log4net::Config::XmlConfigurator::Configure();

        try
        {
            Settings::Load();

            Application::EnableVisualStyles();
            Application::SetCompatibleTextRenderingDefault(false);
            SMain tempVar();
            Application::Run(&tempVar);

            Settings::Save();
        }
        catch (const std::runtime_error &ex)
        {
            Logger::GetLogger()->Error(ex);
        }
    }
}
